class CreateProfiles < ActiveRecord::Migration
  def self.up
    create_table :profiles do |t|
      t.string :first_name, :null => false
      t.string :last_name, :null => false
      t.string :email, :null => false
      t.integer :updated_by
      t.boolean :is_disabled

      t.timestamps
    end
    define_foreign_key_column :profiles, :updated_by, :profiles

    #TODO: Change email address
    Profile.create(:first_name => "System",
                   :last_name => "User",
                   :email => "system@a.com")
  end

  def self.down
    remove_foreign_key_column :profiles, :updated_by
    drop_table :profiles
  end
end
